package com.solutec.tag10;

public class Thema1_ForEach {

	public static void main(String[] args) {

		System.out.println("----- A. for ---------");
		
		int[] arr1 = { 1,2,3,4,5 }; //length = 0
		int[] arr2 = arr1;
		
		for(int i1=0;i1<arr1.length;i1++){
			System.out.print(arr1[i1] + " ");
		}
		System.out.println();
		
		System.out.println("----- B. foreach -----");
		for(int value:arr1){
			System.out.print(value + " ");
		}
		System.out.println();
		
		System.out.println("-------- C. ----------");
		int pos = 0;
		for( int value : arr1 ) {
			System.out.println("Pos.: " + pos + ", Value = " + value);
			pos++;
		}
		
		System.out.println("-------- D. ----------");
		
		//Array erzeugen: false, true, true, false
//		boolean[] arrBool = new boolean[4];
//		arrBool[1] = true;
//		arrBool[2] = true;
		
		boolean[] arrch = {false, true, true, false};
		boolean[] a1 = new boolean[4];
		a1[1] = true;
		a1[2] = true;
		
		//Array mit forEach ausgeben
		for(boolean i : a1){
			System.out.print(i + " ");
		}
		
	}// end of main

}
